{% extends "base/base.html" %}

{% comment %}

 Copyright 2013 - Tom Alessi

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and 
 limitations under the License.

{% endcomment %}


{% block content %}
{% load humanize %}

 <table class="history">
  <tr>
   <td>Target:<b>{{url}}</b></td>
   <td width="10"></td>
   <td>Date:<b>{{date}}</b></td>
   <td>Account Type:<b>{{account_type.0.config_value}}</b></td>
  </tr>
 </table>

<br>


  {% comment %}
   Paid accounts have much more data than free accounts.  See what type of account the user
   claims to have and show them the appropriate data
  {% endcomment %}

  {% if account_type.0.config_value == 'free' %}
  {% comment %}
   Its a free account so only show minimal information
  {% endcomment %}
  <b>LINK METRICS</b>
  <div class="spacer_micro"></div>
  <table class="history responsive">

   <tr>
    <th>Url</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'uid' %}<span title="{{row.full_description}}"><u>uid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'ueid' %}<span title="{{row.full_description}}"><u>ueid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
   </tr>

   <tr>
    <td style="text-align:left;">{{url}}</td>
    <td><a href="/seomoz/trends?url={{url}}&metric=uid">{{metrics.0.uid|intcomma}}</a></td>
    <td><a href="/seomoz/trends?url={{url}}&metric=ueid">{{metrics.0.ueid|intcomma}}</a></td>
   </tr>
 
   {% for row in competitors %}
   <tr>
    <td style="text-align:left;" bgcolor="#FFFFCC">{{row.0.url__url}}</td>
     <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=uid">{{row.0.uid|intcomma}}</a></td>
     <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=ueid">{{row.0.ueid|intcomma}}</a></td>
   </tr>
   {% endfor %}
  </table>

  {% else %}
   {% if account_type.0.config_value == 'paid' %}
    {% comment %}
     Its a paid account so show everything
    {% endcomment %}
    <b>LINK METRICS</b>
    <div class="spacer_micro"></div>
    <table class="history responsive">
     <tr>
      <th>Url</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'uid' %}<span title="{{row.full_description}}"><u>uid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'ueid' %}<span title="{{row.full_description}}"><u>ueid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'feid' %}<span title="{{row.full_description}}"><u>feid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'peid' %}<span title="{{row.full_description}}"><u>peid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'ujid' %}<span title="{{row.full_description}}"><u>ujid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'uifq' %}<span title="{{row.full_description}}"><u>uifq</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'uipl' %}<span title="{{row.full_description}}"><u>uipl</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'fid' %}<span title="{{row.full_description}}"><u>fid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'pid' %}<span title="{{row.full_description}}"><u>pid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'fuid' %}<span title="{{row.full_description}}"><u>fuid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'puid' %}<span title="{{row.full_description}}"><u>puid</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'fipl' %}<span title="{{row.full_description}}"><u>fipl</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
     </tr>

     <tr>
      <td style="text-align:left;">{{url}}</td>
      <td><a href="/seomoz/trends?url={{url}}&metric=uid">{{metrics.0.uid|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=ueid">{{metrics.0.ueid|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=feid">{{metrics.0.feid|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=peid">{{metrics.0.peid|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=ujid">{{metrics.0.ujid|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=uifq">{{metrics.0.uifq|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=uipl">{{metrics.0.uipl|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=fid">{{metrics.0.fid|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=pid">{{metrics.0.pid|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=fuid">{{metrics.0.fuid|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=puid">{{metrics.0.puid|intcomma}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=fipl">{{metrics.0.fipl|intcomma}}</a></td>
     </tr>
   
     {% for row in competitors %}
     <tr>
      <td style="text-align:left;" bgcolor="#FFFFCC">{{row.0.url__url}}</td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=uid">{{row.0.uid|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=ueid">{{row.0.ueid|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=feid">{{row.0.feid|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=peid">{{row.0.peid|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=ujid">{{row.0.ujid|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=uifq">{{row.0.uifq|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=uipl">{{row.0.uipl|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=fid">{{row.0.fid|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=pid">{{row.0.pid|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=fuid">{{row.0.fuid|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=puid">{{row.0.puid|intcomma}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=fipl">{{row.0.fipl|intcomma}}</a></td>
     </tr>
     {% endfor %}
    </table>
   {% else %}
    <b><font color="red">
    LINK METRICS: INCORRECT CONFIGURATION VALUE FOR seomoz_account_type
    </font></b>
   {% endif %}
  {% endif %}


<div class="spacer_medium"></div>


  {% comment %}
   Paid accounts have much more data than free accounts.  See what type of account the user
   claims to have and show them the appropriate data
  {% endcomment %}

  {% if account_type.0.config_value == 'free' %}
  {% comment %}
   Its a free account so only show minimal information
  {% endcomment %}
  <b>RANK METRICS</b>
  <div class="spacer_micro"></div>
  <table class="history responsive">

   <tr>
    <th>Url</th>
    <th width="100">{% for row in descriptions %}{% if row.metric == 'fmrp' %}<span title="{{row.full_description}}"><u>fmrp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
    <th width="100">{% for row in descriptions %}{% if row.metric == 'umrp' %}<span title="{{row.full_description}}"><u>umrp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
    <th width="100">{% for row in descriptions %}{% if row.metric == 'upa' %}<span title="{{row.full_description}}"><u>upa</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
    <th width="100">{% for row in descriptions %}{% if row.metric == 'pda' %}<span title="{{row.full_description}}"><u>pda</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
   </tr>

   <tr>
    <td style="text-align:left;">{{url}}</td>
    <td><a href="/seomoz/trends?url={{url}}&metric=fmrp">{{metrics.0.fmrp}}</a></td>
    <td><a href="/seomoz/trends?url={{url}}&metric=umrp">{{metrics.0.umrp}}</a></td>
    <td><a href="/seomoz/trends?url={{url}}&metric=upa">{{metrics.0.upa}}</a></td>
    <td><a href="/seomoz/trends?url={{url}}&metric=pda">{{metrics.0.pda}}</a></td>
   </tr>
 
   {% for row in competitors %}
   <tr>
    <td style="text-align:left;" bgcolor="#FFFFCC">{{row.0.url__url}}</td>
     <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=fmrp">{{row.0.fmrp}}</a></td>
     <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=umrp">{{row.0.umrp}}</a></td>
     <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=upa">{{row.0.upa}}</a></td>
     <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=pda">{{row.0.pda}}</a></td>
   </tr>
   {% endfor %}
  </table>

  {% else %}
   {% if account_type.0.config_value == 'paid' %}
    {% comment %}
     Its a paid account so show everything
    {% endcomment %}

  <b>RANK METRICS</b>
  <div class="spacer_micro"></div>
  <table class="history responsive">
     <tr>
      <th>Url</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'fmrp' %}<span title="{{row.full_description}}"><u>fmrp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'umrp' %}<span title="{{row.full_description}}"><u>umrp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'upa' %}<span title="{{row.full_description}}"><u>upa</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'pda' %}<span title="{{row.full_description}}"><u>pda</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'pmrp' %}<span title="{{row.full_description}}"><u>pmrp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'utrp' %}<span title="{{row.full_description}}"><u>utrp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'ftrp' %}<span title="{{row.full_description}}"><u>ftrp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'ptrp' %}<span title="{{row.full_description}}"><u>ptrp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'uemrp' %}<span title="{{row.full_description}}"><u>uemrp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'fejp' %}<span title="{{row.full_description}}"><u>fejp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'pejp' %}<span title="{{row.full_description}}"><u>pejp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'fjp' %}<span title="{{row.full_description}}"><u>fjp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
      <th width="100">{% for row in descriptions %}{% if row.metric == 'pjp' %}<span title="{{row.full_description}}"><u>pjp</u></span><br>{{row.column_description}}{% endif %}{% endfor %}</th>
     </tr>

     <tr>
      <td style="text-align:left;">{{url}}</td>
      <td><a href="/seomoz/trends?url={{url}}&metric=fmrp">{{metrics.0.fmrp}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=umrp">{{metrics.0.umrp}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=upa">{{metrics.0.upa}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=pda">{{metrics.0.pda}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=pmrp">{{metrics.0.pmrp}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=utrp">{{metrics.0.utrp}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=ftrp">{{metrics.0.ftrp}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=ptrp">{{metrics.0.ptrp}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=uemrp">{{metrics.0.uemrp}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=fejp">{{metrics.0.fejp}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=pejp">{{metrics.0.pejp}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=fjp">{{metrics.0.fjp}}</a></td>
      <td><a href="/seomoz/trends?url={{url}}&metric=pjp">{{metrics.0.pjp}}</a></td>
     </tr>
   
     {% for row in competitors %}
     <tr>
      <td style="text-align:left;" bgcolor="#FFFFCC">{{row.0.url__url}}</td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=fmrp">{{row.0.fmrp}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=umrp">{{row.0.umrp}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=upa">{{row.0.upa}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=pda">{{row.0.pda}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=pmrp">{{row.0.pmrp}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=utrp">{{row.0.utrp}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=ftrp">{{row.0.ftrp}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=ptrp">{{row.0.ptrp}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=uemrp">{{row.0.uemrp}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=fejp">{{row.0.fejp}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=pejp">{{row.0.pejp}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=fjp">{{row.0.fjp}}</a></td>
      <td bgcolor="#FFFFCC"><a href="/seomoz/trends?url={{row.0.url__url}}&metric=pjp">{{row.0.pjp}}</a></td>
     </tr>
     {% endfor %}
    </table>
   {% else %}
    <b><font color="red">
    RANK METRICS: INCORRECT CONFIGURATION VALUE FOR seomoz_account_type
    </font></b>
   {% endif %}
  {% endif %}

 <a href="http://www.seomoz.org"><img src="/html/images/seomoz.png"></a>



{% endblock %}


